<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class TodoTask extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'todo_task';

    protected $primaryKey = 'todo_id';

    const TODO_STATUS_READY = 1;
    const TODO_STATUS_DSTRBT = 2;

    static $todo_status_options = [
        self::TODO_STATUS_READY => '未派发',
        self::TODO_STATUS_DSTRBT => '已派发',
    ];

    static $todo_status_style = [
        self::TODO_STATUS_READY => 'info',
        self::TODO_STATUS_DSTRBT => 'success',
    ];

    public function name()
    {
        return $this->hasOne(AdminUser::class, 'id', 'creator_uid');
    }
}
